using Microsoft.Xna.Framework.Net;

namespace RaptorEngine.Network
{
    public abstract class NetworkTools
    {
        /// <summary>
        /// The maximum number of gamers on the local machine.
        /// </summary>
        public int MAX_LOCAL_GAMERS;
        /// <summary>
        /// The maximum number of gamers on the network.
        /// </summary>
        public int MAX_NETWORK_GAMERS;

        /// <summary>
        /// Gets or sets the packet writer.
        /// </summary>
        /// <value>
        /// The packet writer.
        /// </value>
        public PacketWriter PacketWriter { get; set; }

        /// <summary>
        /// Gets or sets the packet reader.
        /// </summary>
        /// <value>
        /// The packet reader.
        /// </value>
        public PacketReader PacketReader { get; set; }

        /// <summary>
        /// Initializes a new instance of the <see cref="NetworkTools" /> class.
        /// </summary>
        /// <param name="maxLocalGamers">The max number local gamers.</param>
        /// <param name="maxNetworkGamers">The max number network gamers.</param>
        protected NetworkTools(int maxLocalGamers, int maxNetworkGamers)
        {
            MAX_LOCAL_GAMERS = maxLocalGamers;
            MAX_NETWORK_GAMERS = maxNetworkGamers;
        }

        /// <summary>
        /// The packet writer. Handles the writing of packets to a specific gamer.
        /// </summary>
        /// <param name="writer">The packetwriter.</param>
        /// <param name="gamer">The gamer.</param>
        public abstract void NetPacketWriter(PacketWriter writer, LocalNetworkGamer gamer);

        /// <summary>
        /// The packet reader. Handles the reading of incoming packets to a specific gamer.
        /// </summary>
        /// <param name="reader">The packetreader.</param>
        /// <param name="gamer">The gamer.</param>
        public abstract void NetPacketReader(PacketReader reader, LocalNetworkGamer gamer);
    }
}
